<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Dart : Libraries : box2d : DynamicTree</title>
</head>

<body>

<header></header>

<h1 id="title">class <a name='DynamicTree::DynamicTree'>DynamicTree</a></h1>

<section id="inheritance">

<section class="supertype">
<h2>Supertype:</h2>
<ul><li>Object</li></ul>
</section>

</section>

<section id="summary">

 A dynamic tree arranges data in a binary tree to accelerate
 queries such as volume queries and ray casts. Leafs are proxies
 with an AxisAlignedBox. In the tree we expand the proxy box by
 Settings.BOUNDING_BOX_EXTENSION so that the proxy box is bigger than the
 client object. This allows the client object to move by small amounts without
 triggering a tree update.
</section>

<section id="fields">
<h2>Fields</h2>
<dl>
<dt>
<span class="field-type"><code><code><a href='int.html#int::int'>int</a></code></code></span>
<span class="field-name"><code><a name='DynamicTree::MAX_STACK_SIZE'>MAX_STACK_SIZE
</a></code></span>
</dt>
<dd>
</dd>
<dt>
<span class="field-type"><code><code><a href='Vector.html#Vector::Vector'>Vector</a></code></code></span>
<span class="field-name"><code><a name='DynamicTree::center'>center
</a></code></span>
</dt>
<dd>
</dd>
<dt>
<span class="field-type"><code><code><a href='Vector.html#Vector::Vector'>Vector</a></code></code></span>
<span class="field-name"><code><a name='DynamicTree::deltaOne'>deltaOne
</a></code></span>
</dt>
<dd>
</dd>
<dt>
<span class="field-type"><code><code><a href='Vector.html#Vector::Vector'>Vector</a></code></code></span>
<span class="field-name"><code><a name='DynamicTree::deltaTwo'>deltaTwo
</a></code></span>
</dt>
<dd>
</dd>
</dl>
</section>

<section id="constructors">
<h2>Constructors</h2>
<dl>
<dt>
<code><a href='DynamicTree.html#DynamicTree::DynamicTree'>DynamicTree</a>()</code>
</dt>
<dd>

 Constructs a new DynamicTree.
</dd>
</dl>
</section>

<section id="methods">
<h2>Methods</h2>
<dl>
<dt>
<code><code><a href='int.html#int::int'>int</a></code> <a name='DynamicTree::computeHeightFromRoot'>computeHeightFromRoot</a>()</code></dt>
<dd>
 Computes the height of the overall tree. </dd>
<dt>
<code><code><a href='DynamicTreeNode.html#DynamicTreeNode::DynamicTreeNode'>DynamicTreeNode</a></code> <a name='DynamicTree::createProxy'>createProxy</a>(<code><a href='AxisAlignedBox.html#AxisAlignedBox::AxisAlignedBox'>AxisAlignedBox</a></code> <a name='DynamicTree::createProxy::box'>box</a>, <code><a href='Object.html#Object::Object'>Object</a></code> <a name='DynamicTree::createProxy::userData'>userData</a>)</code></dt>
<dd>

 Create a proxy. Provides a tight fitting axis aligned box
 and a userData pointer.
</dd>
<dt>
<code>void <a name='DynamicTree::destroyProxy'>destroyProxy</a>(<code><a href='DynamicTreeNode.html#DynamicTreeNode::DynamicTreeNode'>DynamicTreeNode</a></code> <a name='DynamicTree::destroyProxy::toDestroy'>toDestroy</a>)</code></dt>
<dd>
</dd>
<dt>
<code><code><a href='bool.html#bool::bool'>bool</a></code> <a name='DynamicTree::moveProxy'>moveProxy</a>(<code><a href='DynamicTreeNode.html#DynamicTreeNode::DynamicTreeNode'>DynamicTreeNode</a></code> <a name='DynamicTree::moveProxy::argProxy'>argProxy</a>, <code><a href='AxisAlignedBox.html#AxisAlignedBox::AxisAlignedBox'>AxisAlignedBox</a></code> <a name='DynamicTree::moveProxy::argBox'>argBox</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='DynamicTree::moveProxy::displacement'>displacement</a>)</code></dt>
<dd>

 Move a proxy with a swept AABB. If the proxy has moved outside of its
 fattened AABB, then the proxy is removed from the tree and re-inserted.
 Otherwise, the function returns immediately.

 Returns true if the given proxy was re-inserted.
</dd>
<dt>
<code>void <a name='DynamicTree::query'>query</a>(<code><a href='TreeCallback.html#TreeCallback::TreeCallback'>TreeCallback</a></code> <a name='DynamicTree::query::callback'>callback</a>, <code><a href='AxisAlignedBox.html#AxisAlignedBox::AxisAlignedBox'>AxisAlignedBox</a></code> <a name='DynamicTree::query::argBox'>argBox</a>)</code></dt>
<dd>

 Queries a bounding box for overlapping proxies. The callback class is
 called for each proxy that overlaps the given bounding box.
</dd>
<dt>
<code>void <a name='DynamicTree::rebalance'>rebalance</a>(<code><a href='int.html#int::int'>int</a></code> <a name='DynamicTree::rebalance::iterations'>iterations</a>)</code></dt>
<dd>

 Rebalances the tree for the given number of iterations. Does a post-order
 traversal of the tree. If given enough iterations it will hit all nodes of
 the tree. Starts at the last reinserted leaf.
</dd>
</dl>
</section>

<footer></footer>

</body></html>
